//
//  LMVerticalBtn.m
//  easybook
//
//  Created by longmin on 16/7/7.
//  Copyright © 2016年 longmin. All rights reserved.
//

#import "LMVerticalBtn.h"

@interface LMVerticalBtn()

@property(nonatomic, assign) CGFloat imgBottom;

@end

@implementation LMVerticalBtn

- (instancetype)initWithFrame:(CGRect)frame
{
    self = [super initWithFrame:frame];
    if (self) {
        self.titleLabel.textAlignment = NSTextAlignmentCenter;
        self.titleLabel.font = _kFontSub;
        [self setTitleColor:kColorA6A6A6 forState:UIControlStateNormal];
        self.imgBottom = 50;
        
    }
    return self;
}

-(CGRect)imageRectForContentRect:(CGRect)contentRect{
    CGFloat imageW = 50;
    
    CGRect imageRect = CGRectMake((contentRect.size.width-imageW) * 0.5,
                                  0,
                                  imageW, imageW);
    
    return imageRect;
}

-(CGRect)titleRectForContentRect:(CGRect)contentRect{
    CGFloat titleW = 30 * [UIScreen mainScreen].bounds.size.width ;
    CGFloat titleH = 15;
    CGRect titleRect = CGRectMake((contentRect.size.width-titleW) * 0.5,
                                  self.imgBottom + 5,
                                  titleW,
                                  titleH);
    return titleRect;
}

@end

